package com.hopu.dy.service.impl;

import com.hopu.dy.mapper.PingLunMapper;
import com.hopu.dy.pojo.GongNeng;
import com.hopu.dy.pojo.Person;
import com.hopu.dy.service.IPingLunService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PingLunServiceImpl implements IPingLunService {
    @Resource
    private PingLunMapper pingLunMapper;

    @Override
    public List<Person> get() {
        return pingLunMapper.select();
    }
    @Override
    public boolean addComment(Person person) {
        return pingLunMapper.insert(person) > 0;
    }
    //点赞
    @Override
    public boolean updateLoveNumber(long id) {
        return pingLunMapper.incrementLove(id) > 0;
    }

    @Override
    public long getLoveCount(long id) {
        return 0;
    }
}